//
// Created by chnlich on 6/27/15.
//

#ifndef STORAGE_ORIENTED_PARALLEL_ADVANCED_DATA_STRUCTURE_DATABASE_INTERFACE_H
#define STORAGE_ORIENTED_PARALLEL_ADVANCED_DATA_STRUCTURE_DATABASE_INTERFACE_H

#include "database_type.h"
#include "database_storage.h"

int32_t db_manage_init();

int32_t db_create_db(int32_t key_length, int32_t value_length);

int32_t db_close_db(int32_t db_id);

int32_t db_insert_data(int32_t db_id, struct database_item *d);

int32_t db_delete_data(int32_t db_id, cond_func f);

int32_t db_delete_data_from_key(int32_t db_id, struct database_keypair *key);

int32_t db_query_data(int32_t db_id, cond_func f, struct database_item_list **ret);

int32_t db_query_data_from_key(int32_t db_id, struct database_keypair *key, struct database_item_list **ret);

int32_t db_save(int32_t db_id, const char *file_name);

int32_t db_load(const char *file_name);


#endif //STORAGE_ORIENTED_PARALLEL_ADVANCED_DATA_STRUCTURE_DATABASE_INTERFACE_H
